<?php
//发送邮件
require_once (dirname(__FILE__) . "/../include/common.inc.php");
require_once(DEDEINC.'/mail.class.php');
require_once(DEDEINC.'/dedetemplate.class.php');
$aid=$_REQUEST['aid'];

$aid = (isset($aid) && is_numeric($aid)) ? $aid : 0;

if($aid==0)
{
ShowMsg('线路编号错误，本操作无效！', '-1');
exit();
}

$ww=$dsql->getone("select * from `#@__archives` where id='$aid'");
if($ww['id']=='')
{
ShowMsg('线路编号不存在，本操作无效！', '-1');
exit();
}






if($dopost=="go")
{
	
if($cfg_sendmail_bysmtp <> 'Y')
{
ShowMsg('管理员关闭了邮件功能呢！', '-1');
exit();	
}
else
{
	
	
$mailtype = 'TXT';
$mailbody='<a href=""'.$cfg_basehost.'"/plus/view.php?aid="'.$aid.'"">点击本地址预览线路详细信息("'.$cfg_basehost.'"/plus/view.php?aid="'.$aid.'")</a>';
$smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password);
		$smtp->debug = false;
		$smtp->sendmail($email_address1,$cfg_webname ,$email_address2, $title, $mailbody, $mailtype);


ShowMsg('成功发送邮件，因网络环境不同，可能会有所延迟，请稍后登录你的邮箱进行接收！', '/');
exit();
	
}


		
}



global $cfg_basedir,$cfg_templets_dir,$cfg_df_style;
$tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/sendmail.htm";
$dtp = new DedeTemplate();
$dtp->Assign('carts',$carts);
$dtp->LoadTemplate($tmpfile);
$dtp->Display();
exit;
?>